<?php
class ItemsController extends BaseController 
{
	protected function fetchRandomItem()
	{
		$model = new ItemsModel();		
		echo $model->fetchRandomItem($this->param['di']);
	}
	
	protected function fetchItemsByString()
    {
		$model = new ItemsModel();
        echo $model->fetchItemsByString($this->param['t']);
    }
    
    protected function insertItem()
    {
    	$model = new ItemsModel();
    	echo $model->insertItem($this->param['mother'], 
    									$this->param['fore']);
    }
    
    protected function updateItem()
    {
    	
    	$model = new ItemsModel();
    	echo $model->updateItem($this->param['id'], 
    									$this->param['mother'], 
    									$this->param['fore']);
    }
    
    protected function deleteItem()
    {
    	$model = new ItemsModel();
    	echo $model->deleteItem($this->param['id']);
    }
    
    protected function insertBatch()
    {
    	$model = new ItemsModel();
    	echo $model->insertBatch($this->param['b']);
    }
    
    protected function truncateTable()
    {
    	$model = new ItemsModel();
    	echo $model->truncateTable();
    }
    
    protected function dumpTable()
    {
    	$model = new ItemsModel();
    	echo $model->dumpTable();
    }
}